import json
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.sms.v20210111 import sms_client, models
try:
    cred = credential.Credential("AKIDDD0Zrsd8LHwMVNyJN9esqWv3vWprd7KG", "g6E5fz3qLaYFemeFZbMq2xc07xWopZ1D")
    httpProfile = HttpProfile()
    httpProfile.endpoint = "sms.tencentcloudapi.com"

    clientProfile = ClientProfile()
    clientProfile.httpProfile = httpProfile
    client = sms_client.SmsClient(cred, "ap-guangzhou", clientProfile)

    req = models.SendSmsRequest()
    params = {
        "PhoneNumberSet": [ "18282719172" ],
        "SmsSdkAppId": "1400569814",
        "SignName": "林宁l",
        "TemplateId": "1114046",
        "TemplateParamSet": ["1234"]
    }
    req.from_json_string(json.dumps(params))

    resp = client.SendSms(req)
    print(resp.to_json_string())

except TencentCloudSDKException as err:
    print(err)